package BiShi.first;

import java.util.*;
public class Main5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            int[] a = new int[n];
            for(int i = 0; i < n; i++){
                a[i] = sc.nextInt();
            }
            int res = 0;
            int[][] dp = new int[n][n];
            for(int i = 0; i < n-1; i++){
                int [] tep = new int[]{a[i], a[i]};
                for(int j = i+1; j < n; j++){
                    if(a[j]>a[i]){
                        tep[1] = a[j];
                    }
                    if(a[j]<a[i]){
                        tep[0] = a[j];
                    }
                    dp[i][j] = tep[0] ^ tep[1];
                    res = res ^ dp[i][j];
                }

            }
            System.out.println(res);

        }
    }
}



